#ifndef HEARTBESTPROTOCOL_H
#define HEARTBESTPROTOCOL_H

#include <QObject>
#include "Protocol/BaseProtocol.h"
#include "DataType/PortStruct.h"
#include "System/CheckCode.h"

class HeartBestProtocol : public BaseProtocol
{
    Q_OBJECT
public:
    explicit HeartBestProtocol(QObject *parent = 0);
    QList<Package> parseData(QByteArray data);
    QByteArray generateData(Package package);

    enum FunctionCode
    {
       HeartBest = 0xab,
    };

    enum ResponseCode
    {
        Succeed = 0,
        CmdBodyError = 4,
        AesLengthError = 36,
        ClientTypeError = 37,
        LoginTimeError = 12,
        AccountNullError = 31,
        PasswordNullError = 32,
        AccountUnboundError = 39,
        PasswordWrongError = 34,
    };

private:

    enum CheckSteps
    {
        CHECK_HEAD,
        CHECK_VERSION,
        CHECK_ID,
        CHECK_FUNCTION,
        CHECK_LENGTH,
        CHECK_BODY,
        CHECK_CHECKCODE,
    };

};




#endif // HEARTBESTPROTOCOL_H
